package com.neusoft.util;

import java.io.IOException;
import java.io.InputStream;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.mybatis.spring.SqlSessionTemplate;

public class MybatisUtils {
	
	private  SqlSessionTemplate  sqlSessionTemplete;
	
	public void setSqlSessionTemplete(SqlSessionTemplate sqlSessionTemplete) {
		this.sqlSessionTemplete = sqlSessionTemplete;
	}
	
	public SqlSession openSession() {
		return sqlSessionTemplete.getSqlSessionFactory().openSession();
	}
	
	public void closeSession(SqlSession session){
		session.close();
	}
	
}
